bcm2835-v4l2: Fix buffer overflow problem
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Fri, 10 Mar 2017 14:43:15 +0000 (14:43 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Thu, 15 Feb 2018 17:29:01 +0000 (17:29 +0000)
commit76e710c0c1c97ce56070c1ac9d63ffbc4eadf849
tree910152b6f8ab085b726d000dd64dc127b29098c3
parente6d10db87eaa77e6d32479d731340fa7014871dd
bcm2835-v4l2: Fix buffer overflow problem

https://github.com/raspberrypi/linux/issues/1447
port_parameter_get() failed to account for the header
(u32 id and u32 size) in the size before memcpying
the response into the response buffer, so overrunning
the provided buffer by 8 bytes.

Account for those bytes, and also a belt-and-braces
check to ensure we never copy more than *value_size
bytes into value.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/media/platform/bcm2835/mmal-vchiq.c